package com.anxin.baseproject2.exception;

import android.text.TextUtils;

/**
 * 回调统一请求异常
 */

public class ApiException extends Exception{
    /*错误码*/
    public int code;
    /*显示的信息*/
    public String message;


    public ApiException(int code, String showMsg){
        this.code=code;
        this.message=showMsg;
    }


    @Override
    public String getMessage() {
        return TextUtils.isEmpty(message)?super.getMessage():message;
    }
}
